import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;


public class Testcollection {
	
	public static void main(String[] args) {
		Genericcollection gc=new Genericcollection();
	
		Integer[] ia=new Integer[6]; 
		ia[0]=10;
		ia[1]=20;
		ia[2]=30;
		ia[3]=40;
		ia[4]=50;
		ia[5]=50;
		
		
		Set<Integer> hsi=new HashSet<Integer>() ;
		gc.getcollectiondetails(ia,hsi);
		hsi=new LinkedHashSet<Integer>();
		gc.getcollectiondetails(ia,hsi);		
		hsi=new TreeSet<Integer>();
		gc.getcollectiondetails(ia,hsi);
		List<Integer> ali=new ArrayList<Integer>();
		gc.getcollectiondetails(ia,ali);
		ali=new LinkedList<Integer>();
		gc.getcollectiondetails(ia,ali);
		
		String s0=new String();
		
		String[] s=new String[10];
		s[0]="one";
		s[1]="two";
		s[2]="three";
		s[3]="four";
		s[4]="five";
		s[5]="six";
		s[6]="five";
		s[7]="Five";
		s[8]=null;
		s[9]="";
		
		Set<String> hss=new HashSet<String>();
		gc.getcollectiondetails(s,hss);
		hss=new LinkedHashSet<String>();
		gc.getcollectiondetails(s,hss);
		hss=new TreeSet<String>();
		//gc.getcollectiondetails(s,hss);
		List<String> als=new ArrayList<String>();
		gc.getcollectiondetails(s,als);
		als=new LinkedList<String>();
		gc.getcollectiondetails(s,als);
	
		Student stu[]=new Student[5];
		stu[0]=new Student(1L,"kishan1");
		stu[1]=new Student(2L,"kishan2");
		stu[2]=new Student(3L,"kishan3");
		stu[3]=new Student(4L,"kishan4");
		stu[4]=new Student(5L,"kishan5");
		

		Set<Student> sst=new HashSet<Student>();
		gc.getcollectiondetails(stu,sst);
		sst=new LinkedHashSet<Student>();
		gc.getcollectiondetails(stu,sst);
		sst=new TreeSet<Student>(new MyIdcomp());
		gc.getcollectiondetails(stu,sst);
		List<Student> lst=new ArrayList<Student>();
		gc.getcollectiondetails(stu,lst);
		lst=new LinkedList<Student>();
		gc.getcollectiondetails(stu,lst);
		
	
	}


}


class MyIdcomp implements Comparator<Student>{
	@Override
	public int compare(Student s1,Student s2){
		if(s1.getId()>s2.getId()){
		return 1;
		}else {
			return -1;
		}
	}
}


class MyNamecomp implements Comparator<Student>{
	@Override
	public int compare(Student s1,Student s2){
		return s1.getName().compareTo(s2.getName());
}
}
